home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!samsung!sdd.hp.com!decwrl!sun-barr!newstop!sun!parns.nsc.com
- From: michael@parns.nsc.com (Michael Wagnitz)
- Newsgroups: comp.sources.x
- Subject: v08i097: xmail, Patch2, Part02/05
- Message-ID: <141430@sun.Eng.Sun.COM>
- Date: 28 Aug 90 07:49:22 GMT
- Sender: news@sun.Eng.Sun.COM
- Lines: 1447
- Approved: argv@sun.com
-
- Submitted-by: michael@parns.nsc.com (Michael Wagnitz)
- Posting-number: Volume 8, Issue 97
- Archive-name: xmail/patch2.02
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 2 (of 5)."
- # Contents: Patch.02b
- # Wrapped by michael@harley on Mon Aug 27 12:47:26 1990
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'Patch.02b' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Patch.02b'\"
- else
- echo shar: Extracting \"'Patch.02b'\" \(46178 characters\)
- sed "s/^X//" >'Patch.02b' <<'END_OF_FILE'
- X! cm.type = ClientMessage;
- X! cm.display = XtDisplay(w);
- X! cm.message_type = XInternAtom(XtDisplay(w), "KILL_SELECTION", FALSE);
- X! cm.window = XtWindow(w);
- X! cm.format = 32;
- X! cm.data.l[0] = XA_PRIMARY;
- X!
- X! XSendEvent(XtDisplay(w), cm.window, TRUE, NoEventMask, (XEvent *) &cm);
- X!
- X! for (; *s && !isdigit(*s); s++);
- X! left = s - IndexBuf;
- X! for (; *s && isdigit(*s); s++);
- X! right = s - IndexBuf;
- X!
- X! XtTextSetSelection(w, left, right);
- X!
- X! XtTextSetInsertionPoint(w, pos);
- X } /* SetSelect */
- X
- X
- X--- 1120,1152 ----
- X } /* SetPopup */
- X
- X
- X+ /*
- X+ ** @(#)SetPos() - restore the saved insert position of the widget
- X+ */
- X /* ARGSUSED */
- X+ XtActionProc
- X+ SetPos(w, event, params, num_params)
- X+ Widget w;
- X+ XEvent *event;
- X+ String *params;
- X+ Cardinal *num_params;
- X+ {
- X+ XtTextSetInsertionPoint(w, SavedPos);
- X+ } /* SetPos */
- X+
- X+
- X+ /* ARGSUSED */
- X /*
- X! ** @(#)SetSelect() - flag the index number of the selected message
- X */
- X XtActionProc
- X SetSelect(w, event, params, num_params)
- X! Widget w; /* unused */
- X XEvent *event; /* unused */
- X String *params; /* unused */
- X Cardinal *num_params; /* unused */
- X {
- X! markIndex(">");
- X } /* SetSelect */
- X
- X
- X*** ../v1.1/callMail.c Mon Jun 4 09:48:34 1990
- X--- callMail.c Mon Aug 27 11:09:18 1990
- X***************
- X*** 32,38 ****
- X * EVENT SHALL NATIONAL SEMICONDUCTOR CORPORATION BE LIABLE FOR ANY SPECIAL,
- X * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- X * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- X! * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- X * PERFORMANCE OF THIS SOFTWARE.
- X *
- X * Author: Michael C. Wagnitz - National Semiconductor Corporation
- X--- 32,38 ----
- X * EVENT SHALL NATIONAL SEMICONDUCTOR CORPORATION BE LIABLE FOR ANY SPECIAL,
- X * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- X * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- X! * OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- X * PERFORMANCE OF THIS SOFTWARE.
- X *
- X * Author: Michael C. Wagnitz - National Semiconductor Corporation
- X***************
- X*** 132,145 ****
- X } else if (mailpid) {
- X /*
- X * Parent : close the slave side of pty
- X- * close stdin and stdout
- X * set the mail file descriptor to append mode
- X * register mail input with X
- X */
- X close(slave);
- X- if (mail_fd != 0) /* if we're restarting, mail_fd IS 0 */
- X- close(0);
- X- close(1);
- X fcntl(mail_fd, F_SETFL, FAPPEND);
- X mailInputId = XtAddInput(mail_fd, XtInputReadMask, readMail, NULL);
- X } else {
- X--- 132,141 ----
- X***************
- X*** 160,169 ****
- X argv[0] = Mailpgm;
- X execvp(Mailpgm, argv);
- X /*
- X! * If we fail to make contact, we must re-establish
- X! * access to the terminal screen that started us for
- X! * our error message, because we don't want to send
- X! * it up the xmail pipe. Also, terminate our parent.
- X */
- X if ((slave = open("/dev/tty", O_RDWR)) != -1) {
- X dup2(slave, 1);
- X--- 156,165 ----
- X argv[0] = Mailpgm;
- X execvp(Mailpgm, argv);
- X /*
- X! * If we fail to make contact, we must re-establish access to
- X! * the terminal screen that started us for our error message,
- X! * because we don't want to send it up the xmail pipe.
- X! * Also terminate our parent.
- X */
- X if ((slave = open("/dev/tty", O_RDWR)) != -1) {
- X dup2(slave, 1);
- X***************
- X*** 170,177 ****
- X dup2(slave, 2);
- X perror(Mailpgm);
- X }
- X! sprintf(buf, "kill -INT %s\n", &tmpName[10]);
- X! system(buf);
- X exit(1);
- X }
- X } /* callMail */
- X--- 166,172 ----
- X dup2(slave, 2);
- X perror(Mailpgm);
- X }
- X! kill(getppid(), SIGKILL); /* kill our parent */
- X exit(1);
- X }
- X } /* callMail */
- X*** ../v1.1/callbacks.c Mon Jun 4 09:48:36 1990
- X--- callbacks.c Mon Aug 27 11:09:18 1990
- X***************
- X*** 19,25 ****
- X * EVENT SHALL NATIONAL SEMICONDUCTOR CORPORATION BE LIABLE FOR ANY SPECIAL,
- X * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- X * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- X! * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- X * PERFORMANCE OF THIS SOFTWARE.
- X *
- X * Author: Michael C. Wagnitz - National Semiconductor Corporation
- X--- 19,25 ----
- X * EVENT SHALL NATIONAL SEMICONDUCTOR CORPORATION BE LIABLE FOR ANY SPECIAL,
- X * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- X * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- X! * OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- X * PERFORMANCE OF THIS SOFTWARE.
- X *
- X * Author: Michael C. Wagnitz - National Semiconductor Corporation
- X***************
- X*** 28,37 ****
- X--- 28,41 ----
- X
- X
- X #include "global.h"
- X+ #include "xmailregex.h"
- X #include <sys/wait.h>
- X #include <sys/stat.h>
- X+ #include <sys/types.h>
- X+ #include <sys/time.h>
- X #include <pwd.h>
- X
- X+ extern char otherBuf[BUFSIZ];
- X
- X /*
- X ** @(#)Autograph() - Add user's Sign or sign autograph to outgoing mail
- X***************
- X*** 56,62 ****
- X
- X strcpy(tmp, "Sign"); /* Default will be to use Sign autograph, */
- X if (C && *C == 'a') /* but if asked use their sign autograph. */
- X! strcpy(tmp, "sign");
- X autograph = GetMailEnv(tmp);
- X if (autograph) {
- X for (n = 0; n < BUFSIZ - 2 && *autograph; autograph++)
- X--- 60,66 ----
- X
- X strcpy(tmp, "Sign"); /* Default will be to use Sign autograph, */
- X if (C && *C == 'a') /* but if asked use their sign autograph. */
- X! tmp[0] = 's';
- X autograph = GetMailEnv(tmp);
- X if (autograph) {
- X for (n = 0; n < BUFSIZ - 2 && *autograph; autograph++)
- X***************
- X*** 80,85 ****
- X--- 84,91 ----
- X
- X /*
- X ** @(#)Done() - Send composed message - if closure data says "Deliver"
- X+ ** Attempt to do the task as a forked child. Failing that,
- X+ ** deliver the message by system call(s).
- X */
- X /* ARGSUSED */
- X XtCallbackProc
- X***************
- X*** 90,97 ****
- X {
- X Widget shell;
- X FILE *fp;
- X! char *p, *record, *folder, *getenv();
- X! char From[BUFSIZ], Copy[BUFSIZ], s[BUFSIZ];
- X int n;
- X struct stat st_buf;
- X
- X--- 96,104 ----
- X {
- X Widget shell;
- X FILE *fp;
- X! char *ARGV[3];
- X! char *p, *q, *record, *folder, *getenv();
- X! char From[BUFSIZ], Copy[BUFSIZ], s[BUFSIZ], addressees[BUFSIZ];
- X int n;
- X struct stat st_buf;
- X
- X***************
- X*** 100,112 ****
- X strcmp(shell->core.name, "popup");
- X shell = XtParent(shell));
- X XtDestroyWidget(shell); /* remove our popup prompt box */
- X /*
- X! ** first, prepare the header information (in a second temporary file)
- X */
- X! strcat(tmpName, "_");
- X! if ((fp = fopen(tmpName, "w")) != NULL) {
- X! if (*Recipient)
- X! fprintf(fp, "To: %s\n", alias(Recipient));
- X
- X if (*SubjBuf)
- X fprintf(fp, "Subject: %s\n", SubjBuf);
- X--- 107,131 ----
- X strcmp(shell->core.name, "popup");
- X shell = XtParent(shell));
- X XtDestroyWidget(shell); /* remove our popup prompt box */
- X+
- X+ st_buf.st_size = 0; /* (in case msg file does not exist) */
- X+ stat(tmpName, &st_buf);
- X+
- X+ if ((fp = fopen(tmpName, "a+")) != NULL) { /* (give cat something to do) */
- X+ fprintf(fp, "\n"); /* ensure the last line is a blank */
- X+ fclose(fp);
- X+ if (st_buf.st_size) /* don't count unless text was there */
- X+ st_buf.st_size += 1; /* but try to be accurate for cancel */
- X+ }
- X /*
- X! ** Prepare header information (in a second temporary file)
- X */
- X! if ((fp = fopen((char *)sprintf(s, "%s_", tmpName), "w")) != NULL) {
- X! if (*Recipient) {
- X! strcpy(addressees, alias(Recipient));
- X! if (*addressees)
- X! fprintf(fp, "To: %s\n", addressees);
- X! }
- X
- X if (*SubjBuf)
- X fprintf(fp, "Subject: %s\n", SubjBuf);
- X***************
- X*** 114,140 ****
- X if (*InReply)
- X fprintf(fp, "%s\n", InReply);
- X
- X! if (*CcBuf)
- X! fprintf(fp, "Cc: %s\n", alias(CcBuf));
- X
- X! if (*BccBuf)
- X! fprintf(fp, "Bcc: %s\n", alias(BccBuf));
- X
- X! fprintf(fp, "\n"); /* separate header from text */
- X fclose(fp);
- X }
- X- tmpName[strlen(tmpName) - 1] = '\0'; /* Drop our marker for now */
- X
- X if (strcmp(closure, "Deliver") == 0) {
- X /*
- X ** mail header information and text in temporary file using sendmail
- X */
- X! if (*Recipient && (*SubjBuf ||
- X! (stat(tmpName, &st_buf) == 0 && st_buf.st_size))) {
- X if ((p = GetMailEnv("sendmail")) == NULL)
- X p = XtNewString("/usr/lib/sendmail");
- X! sprintf(s, "cat %s_ %s | %s -toi -om 2> /dev/null", tmpName, tmpName, p);
- X! system(s);
- X XtFree(p);
- X /*
- X ** If user has set 'record' in their .mailrc, add a message copy to that file
- X--- 133,176 ----
- X if (*InReply)
- X fprintf(fp, "%s\n", InReply);
- X
- X! if (*CcBuf) {
- X! p = alias(CcBuf);
- X! if (*p)
- X! fprintf(fp, "Cc: %s\n", p);
- X! }
- X
- X! if (*BccBuf) {
- X! p = alias(BccBuf);
- X! if (*p)
- X! fprintf(fp, "Bcc: %s\n", p);
- X! }
- X
- X! if ((*Recipient || *SubjBuf) && st_buf.st_size)
- X! fprintf(fp, "\n"); /* separate the header from any text */
- X fclose(fp);
- X }
- X
- X+ fp = fopen((char *)sprintf(s, "%s=", tmpName), "w");
- X+ if (fp) { /* try to keep user from overwriting these */
- X+ fprintf(fp,"mv %s_ %s#_ 2> /dev/null\n", tmpName, tmpName);
- X+ fprintf(fp,"mv %s %s# 2> /dev/null\n", tmpName, tmpName);
- X+ }
- X+
- X if (strcmp(closure, "Deliver") == 0) {
- X /*
- X ** mail header information and text in temporary file using sendmail
- X */
- X! if (*addressees && (*SubjBuf || st_buf.st_size)) {
- X if ((p = GetMailEnv("sendmail")) == NULL)
- X p = XtNewString("/usr/lib/sendmail");
- X!
- X! if (fp)
- X! fprintf(fp,"cat %s#_ %s# | %s -toi -om 2> /dev/null\n", tmpName, tmpName, p);
- X! else {
- X! sprintf(s,"cat %s_ %s | %s -toi -om 2> /dev/null", tmpName, tmpName, p);
- X! system(s);
- X! }
- X!
- X XtFree(p);
- X /*
- X ** If user has set 'record' in their .mailrc, add a message copy to that file
- X***************
- X*** 141,211 ****
- X */
- X if (record = GetMailEnv("record")) {
- X p = folder = NULL;
- X! if (*record == '/' || (p = GetMailEnv("outfolder")) == NULL ||
- X (folder = GetMailEnv("folder")) == NULL) {
- X strcpy(Copy, record);
- X if (p) XtFree(p);
- X } else {
- X! if (*folder == '/') {
- X! if (*record != '+')
- X! sprintf(Copy, "%s/%s", folder, record);
- X! else
- X! sprintf(Copy, "%s/%s", folder, &record[1]);
- X! } else {
- X! if (*record != '+')
- X! sprintf(Copy, "%s/%s/%s", getenv("HOME"), folder, record);
- X! else
- X! sprintf(Copy,"%s/%s/%s",getenv("HOME"),folder,&record[1]);
- X! }
- X XtFree(folder);
- X XtFree(p);
- X }
- X- sprintf(From, "From %s `date`", getenv("USER"));
- X- sprintf(s, "echo \"%s\" >> %s;cat %s_ %s >> %s 2> /dev/null; echo \"\" >> %s",
- X- From, Copy, tmpName, tmpName, Copy, Copy);
- X- system(s);
- X XtFree(record);
- X! }
- X! } else {
- X if (! *Recipient)
- X Bell("No recipient specified\n");
- X else
- X Bell("No subject and no message\n");
- X }
- X! } else {
- X! if (*closure == 'c') { /* save any partial message in our dead file */
- X! if ((record = GetMailEnv("DEAD")) == NULL)
- X! sprintf(Copy, "%s/dead.letter", getenv("HOME"));
- X! else {
- X! if (*record == '/')
- X! strcpy(Copy, record);
- X! else if (*record != '+') /* default path is home directory */
- X! sprintf(Copy, "%s/%s", getenv("HOME"), record);
- X! else /* dead letters will never be legal mail messages */
- X! sprintf(Copy, "%s/%s", getenv("HOME"), &record[1]);
- X! XtFree(record);
- X! }
- X! st_buf.st_size = 0; /* (in case msg file does not exist) */
- X! if (*Recipient || *SubjBuf ||
- X! (stat(tmpName, &st_buf) == 0 && st_buf.st_size)) {
- X! n = st_buf.st_size; /* remember num bytes in msg */
- X! if (stat((char *)sprintf(s, "%s_", tmpName), &st_buf) == 0)
- X! n += st_buf.st_size; /* include bytes in header */
- X st_buf.st_size = -1; /* see if our target exists */
- X stat(Copy, &st_buf);
- X- sprintf(s, "cat %s_ %s >> %s 2> /dev/null", tmpName, tmpName, Copy);
- X- system(s);
- X sprintf(s, "\"%s\" [%s] (%d bytes)\n", Copy,
- X (st_buf.st_size >= 0) ? "Appended" : "New file", n);
- X Bell(s);
- X! } else Bell("Nothing to save in your dead letter box\n");
- X }
- X }
- X /*
- X ** remove any message text that may have been created
- X */
- X! sprintf(s, "rm -f %s_ %s", tmpName, tmpName);
- X! system(s);
- X } /* Done */
- X
- X
- X--- 177,317 ----
- X */
- X if (record = GetMailEnv("record")) {
- X p = folder = NULL;
- X! if (*record != '+' || (p = GetMailEnv("outfolder")) == NULL ||
- X (folder = GetMailEnv("folder")) == NULL) {
- X strcpy(Copy, record);
- X if (p) XtFree(p);
- X } else {
- X! if (*folder == '/')
- X! sprintf(Copy, "%s/%s", folder, &record[1]);
- X! else
- X! sprintf(Copy,"%s/%s/%s",getenv("HOME"),folder,&record[1]);
- X XtFree(folder);
- X XtFree(p);
- X }
- X XtFree(record);
- X!
- X! sprintf(From, "From %s `date`", getenv("USER"));
- X! if (fp)
- X! fprintf(fp,"echo \"%s\" >> %s\ncat %s#_ %s# >> %s 2> /dev/null\n",
- X! From, Copy, tmpName, tmpName, Copy);
- X! else {
- X! sprintf(s,"echo \"%s\" >> %s;cat %s_ %s >> %s 2> /dev/null",
- X! From, Copy, tmpName, tmpName, Copy);
- X! system(s);
- X! }
- X! } /* end - if record variable is set */
- X! /*
- X! ** If there are other addresses, add copies to those files and or folders
- X! */
- X! if (*otherBuf) {
- X! FILE *fp1;
- X! /*
- X! ** Prepare (aliased) header information (in a third temporary file)
- X! */
- X! if ((fp1 = fopen((char *)sprintf(s, "%s$", tmpName), "w"))) {
- X! fprintf(fp1, "To: %s\n", Recipient);
- X!
- X! if (*SubjBuf)
- X! fprintf(fp1, "Subject: %s\n", SubjBuf);
- X!
- X! if (*InReply)
- X! fprintf(fp1, "%s\n", InReply);
- X!
- X! if (*CcBuf)
- X! fprintf(fp1, "Cc: %s\n", CcBuf);
- X!
- X! fprintf(fp1, "\n"); /* separate header from text */
- X! fclose(fp1);
- X! }
- X! p = GetMailEnv("outfolder");
- X! folder = GetMailEnv("folder");
- X! for (record = otherBuf; *record;) {
- X! for (q = record; *q && *q != ','; q++);
- X! n = 0;
- X! if (*q == ',') {
- X! *q = '\0';
- X! n = 1;
- X! }
- X! if (*record != '+' || p == NULL || folder == NULL) {
- X! strcpy(Copy, record);
- X! } else {
- X! if (*folder == '/')
- X! sprintf(Copy, "%s/%s", folder, &record[1]);
- X! else
- X! sprintf(Copy,"%s/%s/%s",getenv("HOME"),folder,&record[1]);
- X! }
- X!
- X! sprintf(From, "From %s `date`", getenv("USER"));
- X! if (fp)
- X! fprintf(fp,"echo \"%s\" >>%s\ncat %s$ %s# >>%s 2>/dev/null\n",
- X! From, Copy, tmpName, tmpName, Copy);
- X! else {
- X! sprintf(s,"echo \"%s\" >> %s\n;cat %s$ %s >> %s 2> /dev/null",
- X! From, Copy, tmpName, tmpName, Copy);
- X! system(s);
- X! }
- X! if (n) *q++ = ',';
- X! record = q;
- X! } /* end - for each record in otherBuf */
- X! if (p) XtFree(p);
- X! if (folder) XtFree(folder);
- X! } /* end - if records in otherBuf */
- X! } else { /* end - if something is there to deliver */
- X if (! *Recipient)
- X Bell("No recipient specified\n");
- X else
- X Bell("No subject and no message\n");
- X }
- X! } else { /* do we want to save the message text in dead file */
- X! n = st_buf.st_size; /* remember num bytes in msg text */
- X! if (n == 0 && *closure == 'c')
- X! Bell("No text to save in your dead letter box\n");
- X! else {
- X! if (n && (*closure == 'c' || ! Confirm("REALLY discard this text"))) {
- X! if ((record = GetMailEnv("DEAD")) == NULL)
- X! sprintf(Copy, "%s/dead.letter", getenv("HOME"));
- X! else {
- X! strcpy(Copy, record); /* take whatever is given */
- X! XtFree(record);
- X! }
- X st_buf.st_size = -1; /* see if our target exists */
- X stat(Copy, &st_buf);
- X sprintf(s, "\"%s\" [%s] (%d bytes)\n", Copy,
- X (st_buf.st_size >= 0) ? "Appended" : "New file", n);
- X Bell(s);
- X! if (fp)
- X! fprintf(fp,"cat %s# >> %s 2> /dev/null\n", tmpName, Copy);
- X! else {
- X! sprintf(s, "cat %s >> %s 2> /dev/null", tmpName, Copy);
- X! system(s);
- X! }
- X! }
- X }
- X }
- X /*
- X ** remove any message text that may have been created
- X */
- X! if (! fp) { /* if we failed to make temp file */
- X! sprintf(s, "rm -f %s_ %s %s$ &", tmpName, tmpName, tmpName);
- X! system(s);
- X! } else { /* try to fork this off to a child process */
- X! fprintf(fp, "rm -f %s#_ %s# %s= %s$\n", tmpName,tmpName,tmpName,tmpName);
- X! fclose(fp);
- X! switch (fork()) {
- X! case -1: /* failed, so use old fashioned way */
- X! sprintf(s, "/bin/sh %s= &", tmpName);
- X! system(s);
- X! break;
- X! case 0: /* fork succeeded - we are the child */
- X! sprintf(s, "%s=", tmpName);
- X! ARGV[0] = "/bin/sh";
- X! ARGV[1] = s;
- X! ARGV[2] = NULL;
- X! execv("/bin/sh", ARGV);
- X! break;
- X! }
- X! }
- X } /* Done */
- X
- X
- X***************
- X*** 215,233 ****
- X /* ARGSUSED */
- X XtCallbackProc
- X DoIt(w, closure, call_data)
- X! Widget w;
- X! caddr_t closure;
- X! caddr_t call_data;
- X {
- X! int i, n;
- X
- X
- X! sprintf(Command, "%s\n", closure);
- X! if (mailpid) /* If connections are okay,... */
- X! writeMail(Command);
- X! else if (strcmp(Command, "file %\n") != 0 && strcmp(Command, "inc\n") != 0)
- X Bell("No mail\n"); /* But if no new mail, complain */
- X! else {
- X if (strcmp(mailargv[mailargc - 2], "-f") == 0) {
- X mailargc -= 2; /* throw away any folder argument */
- X mailargv[mailargc] = NULL; /* and NULL end of argument list */
- X--- 321,352 ----
- X /* ARGSUSED */
- X XtCallbackProc
- X DoIt(w, closure, call_data)
- X! Widget w;
- X! caddr_t closure;
- X! caddr_t call_data;
- X {
- X! int i, n;
- X! char buf[BUFSIZ];
- X! Arg args[1];
- X! LabelWidget lw = (LabelWidget) WidgetOf(WidgetOf(WidgetOf(toplevel,
- X! "topBox"), "titleBar"), "titleBar");
- X
- X+ sprintf(Command, "%s\n", closure);
- X+ if (mailpid) { /* If connections are okay,... */
- X+ if ((n = match(&command_pattern, Command)) != C_FILE && n != C_NEWMAIL)
- X+ writeMail(Command);
- X+ else { /* check for commit of any changes */
- X+ XtSetArg(args[0], XtNlabel, (XtArgVal) NULL);
- X+ XtGetValues(lw, args, ONE);
- X+ strcpy(buf, (char *)args[0].value);
- X
- X! if (strcmp(&buf[strlen(buf) - 7], "deleted") ||
- X! Confirm("COMMIT all changes to this folder"))
- X! writeMail(Command);
- X! }
- X! } else if (C_NEWMAIL != match(&command_pattern, Command))
- X Bell("No mail\n"); /* But if no new mail, complain */
- X! else {
- X if (strcmp(mailargv[mailargc - 2], "-f") == 0) {
- X mailargc -= 2; /* throw away any folder argument */
- X mailargv[mailargc] = NULL; /* and NULL end of argument list */
- X***************
- X*** 235,241 ****
- X callMail(mailargc, mailargv); /* restart the mail connections */
- X strcpy(Command, "Start"); /* Let em know we've re-started */
- X UnsetNewmail(w, NULL, NULL);
- X! }
- X } /* DoIt */
- X
- X
- X--- 354,360 ----
- X callMail(mailargc, mailargv); /* restart the mail connections */
- X strcpy(Command, "Start"); /* Let em know we've re-started */
- X UnsetNewmail(w, NULL, NULL);
- X! }
- X } /* DoIt */
- X
- X
- X***************
- X*** 263,276 ****
- X caddr_t closure;
- X caddr_t call_data;
- X {
- X! union wait status;
- X Display *dpy = XtDisplay(toplevel);
- X
- X! if (mailpid) {
- X! sprintf(Command, "%s\n", closure);
- X! writeMail(Command);
- X! wait3(&status, WNOHANG, NULL);
- X }
- X XtDestroyWidget(toplevel);
- X XCloseDisplay(dpy);
- X exit(0);
- X--- 382,407 ----
- X caddr_t closure;
- X caddr_t call_data;
- X {
- X! Arg args[1];
- X Display *dpy = XtDisplay(toplevel);
- X+ LabelWidget lw = (LabelWidget) WidgetOf(WidgetOf(WidgetOf(toplevel,
- X+ "topBox"), "titleBar"), "titleBar");
- X+ char buf[BUFSIZ];
- X+ union wait status;
- X
- X! if (mailpid) { /* check for commit of any changes */
- X! XtSetArg(args[0], XtNlabel, (XtArgVal) NULL);
- X! XtGetValues(lw, args, ONE);
- X! strcpy(buf, (char *)args[0].value);
- X!
- X! if (*closure != 'q' || strcmp(&buf[strlen(buf) - 7], "deleted") ||
- X! Confirm("Changes in folder. REALLY quit")) {
- X! sprintf(Command, "%s\n", closure);
- X! writeMail(Command);
- X! wait3(&status, WNOHANG, NULL);
- X! } else return;
- X }
- X+
- X XtDestroyWidget(toplevel);
- X XCloseDisplay(dpy);
- X exit(0);
- X***************
- X*** 279,284 ****
- X--- 410,417 ----
- X
- X /*
- X ** @(#)DoSet() - send specified set request to mail and destroy current menu.
- X+ ** To accommodate those systems (Sony?) whose mail cannot handle
- X+ ** 'set no' commands, convert 'set no's to unsets.
- X */
- X /* ARGSUSED */
- X XtCallbackProc
- X***************
- X*** 293,302 ****
- X if (! mailpid) /* If connections are okay,... */
- X Bell("No mail\n"); /* if no new mail, complain */
- X else {
- X! sprintf(buf, "set %s", w->core.name);
- X! c = QueryMail(buf);
- X! XtFree(c);
- X
- X XtDestroyWidget(XtParent(XtParent(w)));
- X }
- X } /* DoSet */
- X--- 426,444 ----
- X if (! mailpid) /* If connections are okay,... */
- X Bell("No mail\n"); /* if no new mail, complain */
- X else {
- X! c = w->core.name;
- X! if (strcmp(&c[strlen(c) - 6], "expert") == 0) {
- X! XMail.expert = (*c == 'n') ? 0 : 1;
- X! } else {
- X! if (*c == 'n')
- X! sprintf(buf, "unset %s", &c[2]);
- X! else
- X! sprintf(buf, "set %s", c);
- X
- X+ c = QueryMail(buf);
- X+ XtFree(c);
- X+ }
- X+
- X XtDestroyWidget(XtParent(XtParent(w)));
- X }
- X } /* DoSet */
- X***************
- X*** 313,325 ****
- X caddr_t call_data;
- X {
- X XtTextPosition pos;
- X int num;
- X
- X if (! mailpid)
- X Bell("No mail\n");
- X else {
- X! pos = XtTextGetInsertionPoint(WidgetOf(WidgetOf(toplevel, "topBox"), "indexWindow"));
- X num = PositionToMsgNumber(pos); /* no current message returns zero */
- X if (*client_data == 'u' && IndexBuf[pos + 1] != 'D') num = 0;
- X if (num) sprintf(Command, "%s %d\n", client_data, num);
- X else sprintf(Command, "%s \n", client_data);
- X--- 455,469 ----
- X caddr_t call_data;
- X {
- X XtTextPosition pos;
- X+ Widget iw = WidgetOf(WidgetOf(toplevel, "topBox"), "indexWindow");
- X int num;
- X
- X if (! mailpid)
- X Bell("No mail\n");
- X else {
- X! pos = XtTextGetInsertionPoint(iw);
- X num = PositionToMsgNumber(pos); /* no current message returns zero */
- X+ pos = XtTextGetInsertionPoint(iw);
- X if (*client_data == 'u' && IndexBuf[pos + 1] != 'D') num = 0;
- X if (num) sprintf(Command, "%s %d\n", client_data, num);
- X else sprintf(Command, "%s \n", client_data);
- X***************
- X*** 328,334 ****
- X--- 472,495 ----
- X } /* DoWith */
- X
- X
- X+ /* ARGSUSED */
- X /*
- X+ ** @(#)DropIt() - callback to destroy the current folder popup list(s)
- X+ */
- X+ XtCallbackProc
- X+ DropIt(w, client_data, call_data)
- X+ Widget w;
- X+ caddr_t client_data;
- X+ caddr_t call_data;
- X+ {
- X+ Widget popup = WidgetOf(WidgetOf(WidgetOf(WidgetOf(toplevel, "topBox"),
- X+ "commandPanel"), "Folder"), "popupList");
- X+ if (popup)
- X+ XtDestroyWidget(popup);
- X+ } /* DropIt */
- X+
- X+
- X+ /*
- X ** @(#)GetAliasName() - retrieve alias name from button label
- X */
- X /* ARGSUSED */
- X***************
- X*** 396,401 ****
- X--- 557,586 ----
- X
- X
- X /*
- X+ ** @(#)ReEdit() - Call the editMail routine to re-edit a message
- X+ */
- X+ /* ARGSUSED */
- X+ XtCallbackProc
- X+ ReEdit(w, closure, call_data)
- X+ Widget w;
- X+ caddr_t closure;
- X+ caddr_t call_data;
- X+ {
- X+ Widget Popup = XtParent(XtParent(XtParent(XtParent(XtParent(w)))));
- X+ Widget To = WidgetOf(WidgetOf(Popup, "SubjCc"), "To");
- X+
- X+
- X+ XtPopdown(XtParent(XtParent(w))); /* drop the sub-menu popup */
- X+ XtPopdown(Popup); /* pop down the send popup */
- X+
- X+ editMail(); /* re-edit the message file */
- X+
- X+ XtPopup(Popup, XtGrabNone); /* pop back the send popup */
- X+ XWarpPointer(XtDisplay(toplevel), None, XtWindow(To), 0, 0, 0, 0, 10, 5);
- X+ } /* ReEdit */
- X+
- X+
- X+ /*
- X ** @(#)Reply() - send a reply to the author of the selected message
- X ** include its text and/or copy the other recipients, if asked.
- X */
- X***************
- X*** 411,416 ****
- X--- 596,602 ----
- X Position pos;
- X String *params, p, q, r;
- X String txt, ccList, author, subject, others, date, reference, empty;
- X+ Widget sb = WidgetOf(WidgetOf(WidgetOf(toplevel,"topBox"),"commandPanel"),"Send");
- X char *us, *getlogin();
- X int erasable = 0;
- X int alwaysIgnore;
- X***************
- X*** 425,434 ****
- X
- X if (p = GetMailEnv("alwaysignore")) {
- X XtFree(p);
- X! alwaysIgnore = 1;
- X } else alwaysIgnore = 0;
- X
- X! if (alwaysIgnore) /* use 'alwaysignore' to decide how we print */
- X sprintf(Command, "p %d", PositionToMsgNumber(pos));
- X else
- X sprintf(Command, "P %d", PositionToMsgNumber(pos));
- X--- 611,620 ----
- X
- X if (p = GetMailEnv("alwaysignore")) {
- X XtFree(p);
- X! alwaysIgnore = (index("SRA", *client_data)) ? 1 : 0;
- X } else alwaysIgnore = 0;
- X
- X! if (alwaysIgnore) /* do we need to include a limited copy? */
- X sprintf(Command, "p %d", PositionToMsgNumber(pos));
- X else
- X sprintf(Command, "P %d", PositionToMsgNumber(pos));
- X***************
- X*** 477,483 ****
- X for (p = txt; *p; p++) {
- X if (strcmp(p, empty) == 0 || strncmp(p, "Status:", 7) == 0) break;
- X
- X! if (strncmp(p, "Return-Path:", 12) == 0) {
- X author = p + 14; /* step over the opening '<' chevron */
- X for (p = author; *p && *p != '>'; p++);
- X if (*p) *p++ = '\0';
- X--- 663,680 ----
- X for (p = txt; *p; p++) {
- X if (strcmp(p, empty) == 0 || strncmp(p, "Status:", 7) == 0) break;
- X
- X! if (strncmp(p, "From ", 5) == 0 ) {
- X! reference = p + 5;
- X! for (p = reference; *p && *p != '\n'; p++);
- X! while (*(p+1) && index(" \t", *(p+1))) {
- X! *p = ' '; /* change this newline to a space */
- X! *(p+1) = ' '; /* change possible tab to a space */
- X! for (p++; *p && *p != '\n'; p++);
- X! }
- X! if (*p) *p = '\0';
- X! }
- X!
- X! else if (strncmp(p, "Return-Path:", 12) == 0) {
- X author = p + 14; /* step over the opening '<' chevron */
- X for (p = author; *p && *p != '>'; p++);
- X if (*p) *p++ = '\0';
- X***************
- X*** 490,498 ****
- X if (*p) *p = '\0';
- X }
- X
- X! else if (strncmp(p, "From:", 5) == 0) {
- X reference = p + 6;
- X for (p = reference; *p && *p != '\n'; p++);
- X if (*p) *p = '\0';
- X }
- X
- X--- 687,700 ----
- X if (*p) *p = '\0';
- X }
- X
- X! else if (strncmp(p, "From:", 5) == 0 && ! *reference ) {
- X reference = p + 6;
- X for (p = reference; *p && *p != '\n'; p++);
- X+ while (*(p+1) && index(" \t", *(p+1))) {
- X+ *p = ' '; /* change this newline to a space */
- X+ *(p+1) = ' '; /* change possible tab to a space */
- X+ for (p++; *p && *p != '\n'; p++);
- X+ }
- X if (*p) *p = '\0';
- X }
- X
- X***************
- X*** 499,504 ****
- X--- 701,711 ----
- X else if (strncmp(p, "To:", 3) == 0) {
- X others = p + 4;
- X for (p = others; *p && *p != '\n'; p++);
- X+ while (*(p+1) && index(" \t", *(p+1))) {
- X+ *p = ' '; /* change this newline to a space */
- X+ *(p+1) = ' '; /* change possible tab to a space */
- X+ for (p++; *p && *p != '\n'; p++);
- X+ }
- X if (*p) *p = '\0';
- X }
- X
- X***************
- X*** 505,510 ****
- X--- 712,722 ----
- X else if (strncmp(p, "Subject:", 8) == 0) {
- X subject = p + 9;
- X for (p = subject; *p && *p != '\n'; p++);
- X+ while (*(p+1) && index(" \t", *(p+1))) {
- X+ *p = ' '; /* change this newline to a space */
- X+ *(p+1) = ' '; /* change possible tab to a space */
- X+ for (p++; *p && *p != '\n'; p++);
- X+ }
- X if (*p) *p = '\0';
- X }
- X
- X***************
- X*** 511,516 ****
- X--- 723,733 ----
- X else if (strncmp(p, "Cc:", 3) == 0) {
- X ccList = p + 4;
- X for (p = ccList; *p && *p != '\n'; p++);
- X+ while (*(p+1) && index(" \t", *(p+1))) {
- X+ *p = ' '; /* change this newline to a space */
- X+ *(p+1) = ' '; /* change possible tab to a space */
- X+ for (p++; *p && *p != '\n'; p++);
- X+ }
- X if (*p) *p = '\0';
- X }
- X else for (; *p && *p != '\n'; p++);
- X***************
- X*** 575,581 ****
- X strcpy(InReply, empty);
- X if (*client_data != 's' && *reference && *date) {
- X r = (*client_data == 'S') ? "Forwarding" : "In-Reply-To";
- X! sprintf(InReply, "%s: Mail from '%s' dated %s", r, reference, date);
- X }
- X
- X strcpy(SubjBuf, empty);
- X--- 792,798 ----
- X strcpy(InReply, empty);
- X if (*client_data != 's' && *reference && *date) {
- X r = (*client_data == 'S') ? "Forwarding" : "In-Reply-To";
- X! sprintf(InReply, "%s: Mail from '%s'\n\tdated %s", r, reference, date);
- X }
- X
- X strcpy(SubjBuf, empty);
- X***************
- X*** 588,594 ****
- X strcpy(CcBuf, ccList);
- X strcpy(BccBuf, empty);
- X
- X! sendMail(w);
- X } /* Reply */
- X
- X
- X--- 805,811 ----
- X strcpy(CcBuf, ccList);
- X strcpy(BccBuf, empty);
- X
- X! sendMail(sb);
- X } /* Reply */
- X
- X
- X***************
- X*** 613,619 ****
- X pos = XtTextGetInsertionPoint(WidgetOf(WidgetOf(toplevel, "topBox"), "indexWindow"));
- X num = PositionToMsgNumber(pos); /* no current message returns zero */
- X
- X! if (*cmd == 'C' || *cmd == 'S' || *cmd == 'W' || num == 0) {
- X if (num) {
- X sprintf(Command, "%s %d\n", cmd, num);
- X } else {
- X--- 830,836 ----
- X pos = XtTextGetInsertionPoint(WidgetOf(WidgetOf(toplevel, "topBox"), "indexWindow"));
- X num = PositionToMsgNumber(pos); /* no current message returns zero */
- X
- X! if (*cmd == 'C' || *cmd == 'S' || num == 0) {
- X if (num) {
- X sprintf(Command, "%s %d\n", cmd, num);
- X } else {
- X*** ../v1.1/confirm.c Mon Aug 13 12:56:26 1990
- X--- confirm.c Mon Aug 27 11:09:18 1990
- X***************
- X*** 0 ****
- X--- 1,233 ----
- X+ /*
- X+ * @(#)Confirm - a Yes/No confirmation window with optional prompt argument.
- X+ *
- X+ * From an idea contributed by Mitchell L. Model <mlm@odi.com> on 5-17-89
- X+ *
- X+ * Copyright 1990 by National Semiconductor Corporation
- X+ *
- X+ * Permission to use, copy, modify, and distribute this software and its
- X+ * documentation for any purpose is hereby granted without fee, provided that
- X+ * the above copyright notice appear in all copies and that both that
- X+ * copyright notice and this permission notice appear in supporting
- X+ * documentation, and that the name of National Semiconductor Corporation not
- X+ * be used in advertising or publicity pertaining to distribution of the
- X+ * software without specific, written prior permission.
- X+ *
- X+ * NATIONAL SEMICONDUCTOR CORPORATION MAKES NO REPRESENTATIONS ABOUT THE
- X+ * SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. IT IS PROVIDED "AS IS"
- X+ * WITHOUT EXPRESS OR IMPLIED WARRANTY. NATIONAL SEMICONDUCTOR CORPORATION
- X+ * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
- X+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO
- X+ * EVENT SHALL NATIONAL SEMICONDUCTOR CORPORATION BE LIABLE FOR ANY SPECIAL,
- X+ * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- X+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- X+ * OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- X+ * PERFORMANCE OF THIS SOFTWARE.
- X+ *
- X+ * Author: Michael C. Wagnitz - National Semiconductor Corporation
- X+ *
- X+ */
- X+ #include "global.h"
- X+
- X+ #define btnsepr 7
- X+
- X+ typedef struct _result {
- X+ Bool *popflg;
- X+ Bool *var;
- X+ Widget shell;
- X+ } *Result;
- X+ void
- X+ ProcessOneEvent(display)
- X+ Display *display;
- X+ {
- X+ static XEvent event;
- X+
- X+ XNextEvent(display, &event);
- X+ XtDispatchEvent(&event);
- X+ } /* ProcessOneEvent */
- X+
- X+
- X+ static Result
- X+ MakeResult(shell, popflg, resultvar)
- X+ Bool *popflg, *resultvar;
- X+ Widget shell;
- X+ {
- X+ Result rec = (Result) malloc(sizeof(struct _result));
- X+
- X+ rec->popflg = popflg;
- X+ rec->var = resultvar;
- X+ rec->shell = shell;
- X+
- X+ return rec;
- X+ } /* MakeResult */
- X+
- X+
- X+ /* ARGSUSED */
- X+ /*
- X+ ** ClearConfirm - get rid of the confirmation box.
- X+ */
- X+ void
- X+ ClearConfirm(w, val, result)
- X+ Widget w;
- X+ Bool val;
- X+ Result result;
- X+ {
- X+ Display *display = XtDisplay(w);
- X+
- X+ XtPopdown(result->shell);
- X+ XtDestroyWidget(result->shell);
- X+ *result->popflg = False;
- X+ *result->var = val;
- X+ } /* ClearConfirm */
- X+
- X+
- X+ /* ARGSUSED */
- X+ static void
- X+ Yes(w, result, call_data)
- X+ Widget w;
- X+ Result result;
- X+ caddr_t call_data; /* unused */
- X+ {
- X+ ClearConfirm(w, True, result);
- X+ }
- X+
- X+
- X+ /* ARGSUSED */
- X+ static void
- X+ No(w, result, call_data)
- X+ Widget w; /* unused */
- X+ Result result;
- X+ caddr_t call_data;
- X+ {
- X+ ClearConfirm(w, False, result);
- X+ } /* No */
- X+
- X+
- X+ /*
- X+ * Confirm - put up a window asking for confirmation.
- X+ */
- X+ Bool
- X+ Confirm(prompt)
- X+ char* prompt;
- X+ {
- X+ Arg args[4];
- X+ Bool popped_up = False, result = False;
- X+ Result resultrec;
- X+ String Translations = "<BtnDown>,<BtnUp>:\n";
- X+ Widget shell, form, label, yes, no;
- X+ Window root, child;
- X+ int root_x, root_y, child_x, child_y;
- X+ int nargs, buttons, labelwidth, yeswidth, btnborder, btnwidth;
- X+ char *query = NULL;
- X+
- X+ /*
- X+ ** First, find out if expert flag is set. If so, just return True.
- X+ */
- X+ if (XMail.expert)
- X+ return True;
- X+ /*
- X+ ** Find out where the mouse is, so we can put the confirmation
- X+ ** box right there.
- X+ */
- X+ XQueryPointer(XtDisplay(toplevel), XtWindow(toplevel), &root, &child,
- X+ &root_x, &root_y, &child_x, &child_y, &buttons);
- X+ /*
- X+ ** Construct the confirmation box
- X+ */
- X+ shell=XtCreatePopupShell("Confirm",transientShellWidgetClass,toplevel,args,0);
- X+
- X+ XtSetArg(args[0], XtNtranslations, XtParseTranslationTable(Translations));
- X+ XtSetArg(args[1], XtNborderWidth, (XtArgVal) 0);
- X+ form = XtCreateManagedWidget("form", formWidgetClass, shell, args, TWO);
- X+
- X+ if (! prompt) label = NULL;
- X+ else {
- X+ if (query) XtFree(query);
- X+ query = NULL;
- X+ if (query = XtMalloc(strlen(prompt) + 2)) {
- X+ strcpy(query, prompt);
- X+ strcat(query, "?");
- X+ }
- X+ XtSetArg(args[0], XtNlabel, (XtArgVal) query);
- X+ XtSetArg(args[1], XtNjustify, XtJustifyCenter);
- X+ XtSetArg(args[2], XtNborderWidth, (XtArgVal) 0);
- X+ label = XtCreateManagedWidget("prompt", labelWidgetClass, form, args, 3);
- X+ }
- X+
- X+ nargs = 0;
- X+ XtSetArg(args[nargs], XtNhorizDistance, (XtArgVal) btnsepr); nargs++;
- X+ if (prompt) {
- X+ XtSetArg(args[nargs], XtNfromVert, (XtArgVal) label); nargs++;
- X+ XtSetArg(args[nargs], XtNvertDistance, (XtArgVal) 12); nargs++;
- X+ }
- X+ yes = XtCreateManagedWidget("yes", commandWidgetClass, form, args, nargs);
- X+
- X+ nargs = 0;
- X+ XtSetArg(args[nargs], XtNfromHoriz, (XtArgVal) yes); nargs++;
- X+ XtSetArg(args[nargs], XtNhorizDistance, (XtArgVal) btnsepr); nargs++;
- X+ if (prompt) {
- X+ XtSetArg(args[nargs], XtNfromVert, (XtArgVal) label); nargs++;
- X+ XtSetArg(args[nargs], XtNvertDistance, (XtArgVal) 12); nargs++;
- X+ }
- X+ no = XtCreateManagedWidget("no", commandWidgetClass, form, args, nargs);
- X+
- X+ if (! label)
- X+ labelwidth = 0;
- X+ else {
- X+ XtSetArg(args[0], XtNwidth, (XtArgVal) NULL);
- X+ XtGetValues(label, args, ONE);
- X+ labelwidth = args[0].value;
- X+ }
- X+
- X+ XtSetArg(args[0], XtNwidth, (XtArgVal) NULL);
- X+ XtSetArg(args[1], XtNborder, (XtArgVal) NULL);
- X+ XtGetValues(yes, args, TWO);
- X+
- X+ yeswidth = args[0].value;
- X+ btnborder = args[1].value;
- X+
- X+ btnwidth = (labelwidth - btnsepr - (2 * btnborder)) / 2;
- X+ if (btnwidth < yeswidth) btnwidth = yeswidth;
- X+
- X+ XtSetArg(args[0], XtNwidth, (XtArgVal) btnwidth);
- X+ XtSetValues(yes, args, ONE);
- X+ XtSetValues(no, args, ONE);
- X+
- X+ XtRealizeWidget(shell);
- X+
- X+ XtSetArg(args[0], XtNwidth, (XtArgVal) NULL);
- X+ XtSetArg(args[1], XtNheight, (XtArgVal) NULL);
- X+ XtGetValues(shell, args, TWO);
- X+
- X+ root_x -= args[0].value / 2;
- X+ root_y -= args[1].value / 2;
- X+ /*
- X+ ** Keep confirm popup within root window borders (don't place it off-screen)
- X+ */
- X+ if (root_x + args[0].value > RootWidth)
- X+ root_x = RootWidth - args[0].value;
- X+ if (root_x < 0) root_x = 0;
- X+
- X+ if (root_y + args[0].value > RootHeight)
- X+ root_y = RootHeight - args[0].value;
- X+ if (root_y < 0) root_y = 0;
- X+
- X+ XtSetArg(args[0], XtNx, (XtArgVal) root_x);
- X+ XtSetArg(args[1], XtNy, (XtArgVal) root_y);
- X+ XtSetValues(shell, args, TWO);
- X+
- X+ resultrec = MakeResult(shell, &popped_up, &result);
- X+ XtAddCallback(yes, XtNcallback, Yes, resultrec);
- X+ XtAddCallback(no, XtNcallback, No, resultrec);
- X+
- X+ if (XMail.bellRing) /* ring bell if not silenced by user */
- X+ XBell (XtDisplay (toplevel), 33);
- X+
- X+ XtPopup(shell, XtGrabExclusive);
- X+
- X+ popped_up = True;
- X+
- X+ while (popped_up) ProcessOneEvent(XtDisplay(shell));
- X+
- X+ return result;
- X+ } /* Confirm */
- X*** ../v1.1/defs.h Mon Jun 4 09:48:36 1990
- X--- defs.h Mon Aug 27 11:09:19 1990
- X***************
- X*** 32,38 ****
- X * EVENT SHALL NATIONAL SEMICONDUCTOR CORPORATION BE LIABLE FOR ANY SPECIAL,
- X * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- X * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- X! * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- X * PERFORMANCE OF THIS SOFTWARE.
- X *
- X * Author: Michael C. Wagnitz - National Semiconductor Corporation
- X--- 32,38 ----
- X * EVENT SHALL NATIONAL SEMICONDUCTOR CORPORATION BE LIABLE FOR ANY SPECIAL,
- X * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- X * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- X! * OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- X * PERFORMANCE OF THIS SOFTWARE.
- X *
- X * Author: Michael C. Wagnitz - National Semiconductor Corporation
- X***************
- X*** 49,67 ****
- X #include <X11/Shell.h>
- X #include <X11/Xatom.h>
- X
- X! #if XtSpecificationRelease >= 4
- X! /* R4 */
- X! #include <X11/Xaw/Cardinals.h>
- X! #include <X11/Xaw/VPaned.h>
- X! #include <X11/Xaw/Form.h>
- X! #include <X11/Xaw/AsciiText.h>
- X! #include <X11/Xaw/TextP.h>
- X! #include <X11/Xaw/Box.h>
- X! #include <X11/Xaw/List.h>
- X! #include <X11/Xaw/Command.h>
- X! #include <X11/Xaw/Dialog.h>
- X! #include <X11/Xaw/Label.h>
- X! #else
- X /* R3 */
- X #include <X11/Cardinals.h>
- X #include <X11/VPaned.h>
- X--- 49,55 ----
- X #include <X11/Shell.h>
- X #include <X11/Xatom.h>
- X
- X! #if XtSpecificationRelease < 4
- X /* R3 */
- X #include <X11/Cardinals.h>
- X #include <X11/VPaned.h>
- X***************
- X*** 73,78 ****
- X--- 61,78 ----
- X #include <X11/Command.h>
- X #include <X11/Dialog.h>
- X #include <X11/Label.h>
- X+ #else
- X+ /* R4 */
- X+ #include <X11/Xaw/Cardinals.h>
- X+ #include <X11/Xaw/VPaned.h>
- X+ #include <X11/Xaw/Form.h>
- X+ #include <X11/Xaw/AsciiText.h>
- X+ #include <X11/Xaw/TextP.h>
- X+ #include <X11/Xaw/Box.h>
- X+ #include <X11/Xaw/List.h>
- X+ #include <X11/Xaw/Command.h>
- X+ #include <X11/Xaw/Dialog.h>
- X+ #include <X11/Xaw/Label.h>
- X #endif
- X
- X #define TITLE "xmail 1." /* program title and version string */
- X***************
- X*** 108,115 ****
- X Dimension helpY; /* help y offset from textWindow */
- X Dimension menuX; /* menu x offset from parent */
- X Dimension menuY; /* menu y offset from parent */
- X- Boolean iconic; /* xmail starts in withdrawn state */
- X Boolean bellRing; /* xmail audible bell option */
- X Boolean mailopt_n; /* mail option -n */
- X Boolean mailopt_U; /* mail option -U */
- X Boolean Show_Last; /* xmail show latest option -ls */
- X--- 108,116 ----
- X Dimension helpY; /* help y offset from textWindow */
- X Dimension menuX; /* menu x offset from parent */
- X Dimension menuY; /* menu y offset from parent */
- X Boolean bellRing; /* xmail audible bell option */
- X+ Boolean expert; /* do not confirm destructive acts */
- X+ Boolean iconic; /* xmail starts in withdrawn state */
- X Boolean mailopt_n; /* mail option -n */
- X Boolean mailopt_U; /* mail option -U */
- X Boolean Show_Last; /* xmail show latest option -ls */
- X*** ../v1.1/directory.c Mon Jun 4 09:48:36 1990
- X--- directory.c Mon Aug 27 11:09:19 1990
- X***************
- X*** 19,25 ****
- X * EVENT SHALL NATIONAL SEMICONDUCTOR CORPORATION BE LIABLE FOR ANY SPECIAL,
- X * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- X * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- X! * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- X * PERFORMANCE OF THIS SOFTWARE.
- X *
- X * Author: Michael C. Wagnitz - National Semiconductor Corporation
- X--- 19,25 ----
- X * EVENT SHALL NATIONAL SEMICONDUCTOR CORPORATION BE LIABLE FOR ANY SPECIAL,
- X * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- X * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- X! * OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- X * PERFORMANCE OF THIS SOFTWARE.
- X *
- X * Author: Michael C. Wagnitz - National Semiconductor Corporation
- X***************
- X*** 46,56 ****
- X String *params;
- X Cardinal *num_params;
- X {
- X! Arg args[6];
- X Cardinal label_width, path_length, n, depth, x, y;
- X DIR *new_dir, *dirp;
- X String name, path;
- X! Widget menu, layout, bw;
- X char *s, trans[BUFSIZ], tmp[BUFSIZ];
- X
- X #ifdef SUNOS_4
- X--- 46,56 ----
- X String *params;
- X Cardinal *num_params;
- X {
- X! Arg args[7];
- X Cardinal label_width, path_length, n, depth, x, y;
- X DIR *new_dir, *dirp;
- X String name, path;
- X! Widget menu, layout, bw, above, to_left;
- X char *s, trans[BUFSIZ], tmp[BUFSIZ];
- X
- X #ifdef SUNOS_4
- X***************
- X*** 104,146 ****
- X label_width = (n=strlen(tmp)) ? XTextWidth(TextFontStr, tmp, n) + 12 : 0;
- X
- X if (label_width) {
- X! (void) sprintf(trans, b_Trans, depth, name);
- X
- X! XtSetArg(args[0], XtNwidth, label_width);
- X! XtSetArg(args[1], XtNfont, TextFontStr);
- X! XtSetArg(args[2], XtNcallback, callbacks);
- X! XtSetArg(args[3], XtNtranslations, XtParseTranslationTable(trans));
- X /*
- X ** create the menu buttons
- X */
- X! bw = NULL;
- X! for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp)) {
- X! if (strcmp(dp->d_name, ".") && strcmp(dp->d_name, "..")) {
- X /*
- X ** If this 'folder file' is also a directory, mark it with a trailing slash '/'
- X */
- X! s = XtMalloc(path_length + strlen(dp->d_name) + 2);
- X! sprintf(s, "%s/%s", path, dp->d_name);
- X! if ((new_dir = opendir(s)) != NULL) {
- X! sprintf(tmp, "%s/", dp->d_name);
- X! XtSetArg(args[4], XtNlabel, tmp);
- X! } else
- X! XtSetArg(args[4], XtNlabel, dp->d_name);
- X! XtSetArg(args[5], XtNfromVert, bw);
- X! bw = XtCreateManagedWidget("menubutton",commandWidgetClass,layout,args,6);
- X /*
- X ** If this 'folder' is a directory, add a button popup menu of its files.
- X */
- X! if (new_dir) {
- X! closedir(new_dir);
- X! sprintf(trans, dir_Trans, tmp, s, depth);
- X! XtOverrideTranslations(bw, XtParseTranslationTable(trans));
- X }
- X- XtFree(s);
- X }
- X }
- X- closedir(dirp);
- X- }
- X /*
- X ** If no buttons were created for this menu, destroy the widget.
- X */
- X--- 104,154 ----
- X label_width = (n=strlen(tmp)) ? XTextWidth(TextFontStr, tmp, n) + 12 : 0;
- X
- X if (label_width) {
- X! (void) sprintf(trans, b_Trans, depth, name);
- X
- X! XtSetArg(args[0], XtNwidth, label_width);
- X! XtSetArg(args[1], XtNfont, TextFontStr);
- X! XtSetArg(args[2], XtNcallback, callbacks);
- X! XtSetArg(args[3], XtNtranslations, XtParseTranslationTable(trans));
- X /*
- END_OF_FILE
- if test 46178 -ne `wc -c <'Patch.02b'`; then
- echo shar: \"'Patch.02b'\" unpacked with wrong size!
- fi
- # end of 'Patch.02b'
- fi
- echo shar: End of archive 2 \(of 5\).
- cp /dev/null ark2isdone
- MISSING=""
- for I in 1 2 3 4 5 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 5 archives.
- rm -f ark[1-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-
- dan
- ----------------------------------------------------
- O'Reilly && Associates argv@sun.com / argv@ora.com
- Opinions expressed reflect those of the author only.
-